<div class="row" style="padding: 10px;">
	<#if Session['proj_updater']>
	<div class="col-md-12 col-sm-12 col-xs-12">
		<div class="btn btn-warning btn-sm create-child-contract">
			<i class="icon-plus">&nbsp;</i>
			新建子合同
		</div>
	</div>
	<br>
	<br>
	</#if> <#if data.childrenContract??> <#list data.childrenContract as cc> <#if cc_index%2 == 0>
	<div class="col-md-12 col-sm-12 col-xs-12">
		<div class="row">
			</#if>
			<div class="col-md-6 col-sm-6 col-xs-12">
				<div class="panel panel-default">
					<div class="panel-heading">
						<i class="icon-tasks"></i>
						<div class="form-data">
							<span class="show-data editable">
								<span class="data">${cc.name!'-'}</span>
							</span>
							<span class="edit-data hide">
								<form action="${request.contextPath}/contract/form/edit-field" method="post">
									<input type="hidden" name="id" value="${cc.id}">
									<input type="hidden" name="field" value="name">
									<input class="data" type="text" name="data" value="${cc.name}">
									<i class="icon-ok icon-large" title="确定"></i>
									<i class="icon-remove icon-large" title="取消"></i>
								</form>
							</span>
						</div>
						<#if Session['proj_deleter']>
						<div class="btn btn-xs pull-right delete-child-contract" title="删除" data-id="${cc.id}">
							<i class="text-danger icon-trash icon-large"></i>
						</div>
						</#if>
					</div>
					<div class="panel-body">
						<div class="row">
							<div class="col-md-8 col-sm-8 col-xs-12 proj-card">
								<div class="form-data">
									编号：
									<span class="show-data editable">
										<span class="data">${cc.no!'-'}</span>
									</span>
									<span class="edit-data hide">
										<form action="${request.contextPath}/contract/form/edit-field" method="post">
											<input type="hidden" name="id" value="${cc.id}">
											<input type="hidden" name="field" value="no">
											<input class="data" type="text" name="data" value="${cc.no}">
											<i class="icon-ok icon-large" title="确定"></i>
											<i class="icon-remove icon-large" title="取消"></i>
										</form>
									</span>
								</div>
								<br>
								<div class="form-data">
									工期：
									<span class="show-data editable" data-empty-str="未知">
										<span class="data">${(cc.start?string('yyyy.MM.dd'))!'未知'}</span>
									</span>
									<span class="edit-data hide">
										<form action="${request.contextPath}/contract/form/edit-field" method="post">
											<input type="hidden" name="id" value="${cc.id}">
											<input type="hidden" name="format" value="yyyy.MM.dd">
											<input type="hidden" name="field" value="start">
											<input class="data datetimepicker" data-foot="false" data-format="yyyy.MM.dd" data-time="${(cc.start)!.now}" type="text" name="data" value="${(cc.start?string('yyyy.MM.dd'))!.now?string('yyyy.MM.dd')}" readonly>
											<i class="icon-ok icon-large" title="确定"></i>
											<i class="icon-remove icon-large" title="取消"></i>
										</form>
									</span>
								</div>
								-
								<div class="form-data">
									<span class="show-data editable" data-empty-str="未知">
										<span class="data">${(cc.end?string('yyyy.MM.dd'))!'未知'}</span>
									</span>
									<span class="edit-data hide">
										<form action="${request.contextPath}/contract/form/edit-field" method="post">
											<input type="hidden" name="id" value="${cc.id}">
											<input type="hidden" name="format" value="yyyy.MM.dd">
											<input type="hidden" name="field" value="end">
											<input class="data datetimepicker" data-foot="false" data-format="yyyy.MM.dd" data-time="${(cc.end)!.now}" type="text" name="data" value="${(cc.end?string('yyyy.MM.dd'))!.now?string('yyyy.MM.dd')}" readonly>
											<i class="icon-ok icon-large" title="确定"></i>
											<i class="icon-remove icon-large" title="取消"></i>
										</form>
									</span>
								</div>
								<hr class="info-split">
								<#if cc.members??> <#list cc.members as m>
								<div class="form-data">
									${m.level.val}方：
									<span class="show-data editable">
										<span class="data">${m.company!'-'}</span>
									</span>
									<span class="edit-data hide">
										<form action="${request.contextPath}/contract/form/edit-member" method="post">
											<input type="hidden" name="id" value="${cc.id}">
											<input type="hidden" name="level" value="${m.level}">
											<input type="hidden" name="field" value="company">
											<#if m_index!=0>
											<select class="data" name="data">
												<#list supplierCompany as cc>
												<option value="${cc}" ${(m.company==cc)?string('selected','')}>${cc}</option>
												</#list>
											</select>
											<#else>
											<input class="data" type="text" name="data" value="${m.company}">
											</#if>
											<i class="icon-ok icon-large" title="确定"></i>
											<i class="icon-remove icon-large" title="取消"></i>
										</form>
									</span>
								</div>
								<br>
								</#list> </#if>
								<div class="form-data">
									签订日期：
									<span class="show-data editable" data-empty-str="未知">
										<span class="data">${(cc.signDate?string('yyyy.MM.dd'))!'-'}</span>
									</span>
									<span class="edit-data hide">
										<form action="${request.contextPath}/contract/form/edit-field" method="post">
											<input type="hidden" name="id" value="${cc.id}">
											<input type="hidden" name="format" value="yyyy.MM.dd">
											<input type="hidden" name="field" value="signDate">
											<input class="data datetimepicker" data-foot="false" data-format="yyyy.MM.dd" data-time="${(cc.signDate)!.now}" type="text" name="data" value="${(cc.signDate?string('yyyy.MM.dd'))!.now?string('yyyy.MM.dd')}" readonly>
											<i class="icon-ok icon-large" title="确定"></i>
											<i class="icon-remove icon-large" title="取消"></i>
										</form>
									</span>
								</div>
							</div>
							<div class="col-md-4 col-sm-4 col-xs-12">
								<div class="form-data">
									合同金额：
									<span class="show-data editable">
										<span class="data">${(cc.price?string('currency'))!'-'}</span>
									</span>
									<span class="edit-data hide">
										<form action="${request.contextPath}/contract/form/edit-field" method="post">
											<input type="hidden" name="id" value="${cc.id}">
											<input type="hidden" name="field" value="price">
											<input class="data" type="text" name="data" value="${cc.price}">
											<i class="icon-ok icon-large" title="确定"></i>
											<i class="icon-remove icon-large" title="取消"></i>
										</form>
									</span>
								</div>
								<br>
								<div class="form-data">
									结算金额：
									<span class="show-data editable">
										<span class="data">${(cc.payPrice?string('currency'))!'-'}</span>
									</span>
									<span class="edit-data hide">
										<form action="${request.contextPath}/contract/form/edit-field" method="post">
											<input type="hidden" name="id" value="${cc.id}">
											<input type="hidden" name="field" value="payPrice">
											<input class="data" type="text" name="data" value="${cc.payPrice}">
											<i class="icon-ok icon-large" title="确定"></i>
											<i class="icon-remove icon-large" title="取消"></i>
										</form>
									</span>
								</div>
								<hr class="info-split">
								<div class="form-data">
									付款金额：
									<span class="show-data edit-children-pay" data-contract-id="${cc.id}" style="color: #337ab7; cursor: pointer;">
										<span class="data">${(cc.paymentCount?string('currency'))!'-'}</span>
									</span>
								</div>
								<br>
								<div class="form-data">
									未付金额：
									<span>
										<span class="data">${((cc.payPrice - cc.paymentCount)?string('currency'))!'-'}</span>
									</span>
								</div>
								<hr class="info-split">
								<div class="form-data">
									联系人：
									<span class="show-data editable">
										<span class="data">${(cc.customer.people)!'-'}</span>
									</span>
									<span class="edit-data hide">
										<form action="${request.contextPath}/contract/form/edit-member" method="post">
											<input type="hidden" name="id" value="${cc.id}">
											<input type="hidden" name="level" value="LEVEL1">
											<input type="hidden" name="field" value="people">
											<input class="data" type="text" name="data" value="${cc.customer.people}">
											<i class="icon-ok icon-large" title="确定"></i>
											<i class="icon-remove icon-large" title="取消"></i>
										</form>
									</span>
								</div>
								<br>
								<div class="form-data">
									联系电话：
									<span class="show-data editable">
										<span class="data">${(cc.customer.phone)!'-'}</span>
									</span>
									<span class="edit-data hide">
										<form action="${request.contextPath}/contract/form/edit-member" method="post">
											<input type="hidden" name="id" value="${cc.id}">
											<input type="hidden" name="level" value="LEVEL1">
											<input type="hidden" name="field" value="phone">
											<input class="data" type="text" name="data" value="${cc.customer.phone}">
											<i class="icon-ok icon-large" title="确定"></i>
											<i class="icon-remove icon-large" title="取消"></i>
										</form>
									</span>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<#if cc_index%2 == 1>
		</div>
	</div>
	</#if> </#list><#else>
	<div class="col-md-12 col-sm-12 col-xs-12">暂无子合同</div>
	</#if>
</div>
